<?php

class ShoppingCart extends CI_Controller
{
	function xemgiohang()
	{
		$data = array(
			'page'=>'giohang'
		);
		$this->load->view('templateuser', $data);
	}
	
	function dathang($mahoa)
	{
		$tth = $this->mhoa->thongtinhoa($mahoa);
		$data = array(
			'id'=>$tth->mahoa,
			'name'=>$tth->tenhoa,
			'qty'=>1,
			'price'=>$tth->gia
		);
		$this->cart->insert($data);
		redirect('shoppingcart/xemgiohang');
	}
	
	function xoasanpham($rowid)
	{
		$data = array(
			'rowid'=>$rowid,
			'qty'=>0
		);
		$this->cart->update($data);
		redirect('shoppingcart/xemgiohang');
	}
	
}

?>